<?php
    /******************************************************************************
     *    Copyright ZhangYue
     * Author:                Quinn Xu
     * Description:           
     * Want argument:         
     * Output:                
     * Create Date:           2012-12-26
     *****************************************************************************/
    class banjidefenguanli
    {
        private $shujubiao='banjidefen';
        
        //清空表
        public function qingkongbiao()
        {
            global $db;
            $query = "truncate table {$this->shujubiao}";
            $db->execute($query);
        }
        
        //记录信息
        public function jilu($model)
        {
            global $db;
			$query = "INSERT INTO {$this->shujubiao} (banji,cengci,xishu,renshu,defen) VALUES ('{$model->getBanji()}','{$model->getCengci()}','{$model->getXishu()}','{$model->getRenshu()}','{$model->getDefen()}')";
			$db->execute($query);
			return $db->affected_rows();
        }
        
        //通过班级名获取记录
        public function tongguobanjiduquxinxi($model)
        {
            global $db;
            $query = "SELECT * FROM {$this->shujubiao} WHERE banji={$model->getBanji()}";
            return $db->query($query);
        }
    }
?>